package datasource.bean;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class DateChoice {
    public static final DateChoice DAY_20250201 = new DateChoice("2025-02-01");
    public static final DateChoice DAY_20250202 = new DateChoice("2025-02-02");
    public static final DateChoice DAY_20250203 = new DateChoice("2025-02-03");
    public static final DateChoice DAY_20250204 = new DateChoice("2025-02-04");
    public static final DateChoice DAY_20250205 = new DateChoice("2025-02-05");
    public static final DateChoice DAY_20250206 = new DateChoice("2025-02-06");
    public static final DateChoice DAY_20250207 = new DateChoice("2025-02-07");
    public static final DateChoice DAY_20250208 = new DateChoice("2025-02-08");
    public static final DateChoice DAY_20250209 = new DateChoice("2025-02-09");
    public static final DateChoice DAY_20250210 = new DateChoice("2025-02-10");
    public static final DateChoice DAY_20250211 = new DateChoice("2025-02-11");
    public static final DateChoice DAY_20250212 = new DateChoice("2025-02-12");
    public static final DateChoice DAY_20250213 = new DateChoice("2025-02-13");
    public static final DateChoice DAY_20250214 = new DateChoice("2025-02-14");
    public static final DateChoice DAY_20250215 = new DateChoice("2025-02-15");
    public static final DateChoice DAY_20250216 = new DateChoice("2025-02-16");
    public static final DateChoice DAY_20250217 = new DateChoice("2025-02-17");
    public static final DateChoice DAY_20250218 = new DateChoice("2025-02-18");
    public static final DateChoice DAY_20250219 = new DateChoice("2025-02-19");
    public static final DateChoice DAY_20250220 = new DateChoice("2025-02-20");
    public static final DateChoice DAY_20250221 = new DateChoice("2025-02-21");
    public static final DateChoice DAY_20250222 = new DateChoice("2025-02-22");
    public static final DateChoice DAY_20250223 = new DateChoice("2025-02-23");
    public static final DateChoice DAY_20250224 = new DateChoice("2025-02-24");
    public static final DateChoice DAY_20250225 = new DateChoice("2025-02-25");
    public static final DateChoice DAY_20250226 = new DateChoice("2025-02-26");
    public static final DateChoice DAY_20250227 = new DateChoice("2025-02-27");
    public static final DateChoice DAY_20250228 = new DateChoice("2025-02-28");
    public static final DateChoice DAY_20250301 = new DateChoice("2025-03-01");
    private String date;
    private BufferedWriter bufferedWriter;

    private static HashMap<String, BufferedWriter> maps = new HashMap<>();

    static {
        try {
            maps.put(DAY_20250201.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250201.getDate())));
            maps.put(DAY_20250202.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250202.getDate())));
            maps.put(DAY_20250203.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250203.getDate())));
            maps.put(DAY_20250204.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250204.getDate())));
            maps.put(DAY_20250205.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250205.getDate())));
            maps.put(DAY_20250206.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250206.getDate())));
            maps.put(DAY_20250207.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250207.getDate())));
            maps.put(DAY_20250208.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250208.getDate())));
            maps.put(DAY_20250209.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250209.getDate())));
            maps.put(DAY_20250210.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250210.getDate())));
            maps.put(DAY_20250211.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250211.getDate())));
            maps.put(DAY_20250212.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250212.getDate())));
            maps.put(DAY_20250213.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250213.getDate())));
            maps.put(DAY_20250214.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250214.getDate())));
            maps.put(DAY_20250215.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250215.getDate())));
            maps.put(DAY_20250216.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250216.getDate())));
            maps.put(DAY_20250217.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250217.getDate())));
            maps.put(DAY_20250218.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250218.getDate())));
            maps.put(DAY_20250219.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250219.getDate())));
            maps.put(DAY_20250220.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250220.getDate())));
            maps.put(DAY_20250221.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250221.getDate())));
            maps.put(DAY_20250222.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250222.getDate())));
            maps.put(DAY_20250223.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250223.getDate())));
            maps.put(DAY_20250224.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250224.getDate())));
            maps.put(DAY_20250225.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250225.getDate())));
            maps.put(DAY_20250226.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250226.getDate())));
            maps.put(DAY_20250227.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250227.getDate())));
            maps.put(DAY_20250228.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250228.getDate())));
            maps.put(DAY_20250301.getDate(),new BufferedWriter(new FileWriter("/usr/local/soft/bigdata33/hefei_metro/source/"+DAY_20250301.getDate())));
        }catch (Exception e){
            e.printStackTrace();
        }

    }

    DateChoice() {
    }

    DateChoice(String date) {
        this.date = date;
    }

    DateChoice(String date,BufferedWriter bw){
        this.date = date;
        this.bufferedWriter = bw;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public BufferedWriter getBufferedWriter() {
        return bufferedWriter;
    }

    public void setBufferedWriter(BufferedWriter bufferedWriter) {
        this.bufferedWriter = bufferedWriter;
    }


    public static synchronized BufferedWriter getBW(String date) throws Exception{
        return maps.get(date);
    }

    @Override
    public String toString() {
        return "DateChoice{" +
                "date='" + date + '\'' +
                '}';
    }
}
